package com.feri.buy.auth.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户日志表
 * </p>
 *
 * @author feri
 * @since 2022-02-17
 */
@TableName("t_user_log")
@Data
@NoArgsConstructor
public class UserLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long uid;

    private String info;

    private String ip;

    //类型 1注册 2登录 3.找回密码 4.登陆失败
    private Integer type;

    private LocalDateTime ctime;

    public UserLog(Long uid, String info, Integer type) {
        this.uid = uid;
        this.info = info;
        this.type = type;
        this.ip="127.0.0.1";
        ctime=LocalDateTime.now();
    }
}
